package pl.vanta.utils.gui.panels;

import java.awt.BorderLayout;
import java.awt.Component;

import javax.swing.JLabel;
import javax.swing.JPanel;

public class LabelValuePanel extends JPanel
{
	private static final long	serialVersionUID	= 1L;

	public LabelValuePanel(Component labelComponent, Component valueComponent, boolean resize)
	{
		this.setLayout(new BorderLayout());

		this.add(labelComponent, BorderLayout.WEST);

		if (resize)
		{
			this.add(valueComponent, BorderLayout.CENTER);
		}
		else
		{
			this.add(valueComponent, BorderLayout.EAST);
		}
	}

	public LabelValuePanel(Component labelComponent, Component valueComponent)
	{
		this(labelComponent, valueComponent, true);
	}

	public LabelValuePanel(String label, Component valueComponent)
	{
		this(new JLabel(label), valueComponent, true);
	}
	
	public LabelValuePanel(String label, Component valueComponent, boolean resize)
	{
		this(new JLabel(label), valueComponent, resize);
	}
}